package cards;
import java.util.Scanner;

public class Problem
{
private Candidates candidates = new Candidates();
private Solution   solution   = new Solution();
private Scanner    reader = new Scanner(System.in);
    
public static void main(String[] args){
	Problem problem = new Problem();
	problem.solve();
}
    public void solve()
{
     //System.out.println(candidates);

     
//     reader.nextLine();
     //index op nul zetten
     int index=0;
     //Zolang de index kleiner is dan het aantal kandidaten...
     while (index<candidates.size())
     {
    	 //Als de functie fits true teruggeeft dan...
         if (solution.fits(candidates.get(index)))
         {        	
             solution.record(candidates.remove(index)); //move candidate to solution
             if (solution.complete())
             {                 
                 solution.show();
             }
             else
             {
                 solve();
             }
             candidates.add(index, solution.eraseRecording()); //move candidate to candidates
  
           }
           index++;
      }     
   }

}
        
          
         









